<template>
  <div class="all">
      <div class="head_mom">
      <div class="head">
        <div class="left">
            <div class="U_name">
                <h4 class="name">昵称：</h4>
                <span class="producer_name">{{createrTop.cname}}</span>
            </div>
            <div class="youtube">
                <img src="../../assets/producer_space/youtube_logo.svg"/>
                <h4 class="title">抖音</h4>
                <h5 class="fans">1000W</h5>
            </div>
            <div class="all_msg">
                <div class="msg">
                <span class="msg2">已在本网站成交</span>
                <span class="order_num">{{order_num}}笔</span>
                <span class="msg3">广告</span>
                 </div>
                <div class="tele_num">
                <span class="">电话号码：</span>
                <span class="">{{createrTop.cphone}}</span>
                </div>
                <div class="tele_mail">
                 <span class="">电子邮箱：</span>
                <span class="">{{createrTop.cemail}}</span>
                </div>
            </div>
            <img class="picture" src="../../assets/headhead.png"/>
        </div>
        <div @click="push2()" class="right">
            <div class="right_logo" ><img src="../../assets/producer_space/unload.png"/></div>
            <a class="right_title">退出登录</a>
        </div>
      </div>
      </div>
      <div class="center">
            <div class="advert1" v-for="(item,index1) in boxcard" :key="index1">
                 <div>
                    <img class="vedio_station" src="../../assets/producer_space/youtube_logo.svg"/>
                </div>
                  <el-card class="box-card">
                    <div class="part1">
                        <div class="vedio">
                            <img class="vedio_pic" :src="item.fengmian"/>
                        </div>
                        <div class="fire">
                            <img class="fire-burn" src="../../assets/producer_space/if-fire-burn.png"/>
                            <span class="fire-degree">{{item.vexplosivedegree}}</span>
                            <div  class="time">
                                <span class="time">{{time}}</span>
                            </div>
                        </div>
                        <div class="all_vedio_name">
                            <a class="vedio_name">{{item.vname}}</a><br>
                            <!-- <a class="vedio_name">{{vedio_name2}}</a> -->
                        </div>
                        <el-card class="type"><a class="type_a">{{type[0]}}</a></el-card>
                        <el-card class="type"><a  class="type_a">{{type[1]}}</a></el-card>
                    </div>
                    <div class="line1"></div>
                    <div>
                        <div class="BoxCardPosition" v-for="(item2,index2) in item.advertiserSpaceList" :key="index2">
                            <div class="test2">
                                <div class="part2">
                                    <div class="top_2">
                                        <div>
                                            <span class="top_2_title">广告位{{index2+1}}</span>
                                        </div>
                                        <br>
                                        <div>
                                            <div class="mas_2_all">
                                                <div class="msg_2">时间：<a>{{item2.apbegintime}}</a>-<a>{{item2.apfinaltime}}</a></div>
                                                <div class="msg_2">场景：<a>{{item2.asession}}</a></div>
                                                <div class="msg_2">状态：已合作 <a>{{item2.cooperations.length}}</a> 个广告商</div>
                                                <div class="msg_2">大小：<a>{{item2.apsize}}</a> 10%</div>
                                            </div>
                                        </div>
                                    </div>

                                    <!-- <div class="bottom_2"  v-for="(item3,index3) in item2.cooperations" :key="index3">
                                        <div class="test3">
                                            <div class="bottom_2_11">
                                                <img src="../../assets/producer_space/iconPark.png"/>
                                                <span class="bottom_2_title">{{item3.advertisername}}</span>
                                                <img class="bottm_2_img1" src="../../assets/producer_space/ad-product.png"/>
                                                <span class="bottom_2_title1">{{item3.productname}}</span>
                                            </div>
                                        </div>
                                    </div> -->
                                    <div class="item_message_1">
                                        <div class="item_message_1_1">
                                            <div class="item_message_1_1_1" v-for="(item3,index3) in item2.cooperations" :key="index3">
                                                <a class="adverwidth">
                                                    <img src="../../assets/adver_video_detail/iconPark-ad.png"/>
                                                    <a class="font_group">{{item3.advertisername}}</a>
                                                </a>
                                                <a class="item_message_1_2_1" >
                                                    <img src="../../assets/adver_video_detail/iconPark-ad-product.png"/>
                                                    <a class="font_group">{{item3.productname}}</a>
                                                </a>
                                            </div >
                                        </div>
                                    </div>  
                                </div>
                            </div>
                            <div class="buttonP">
                            <el-button @click="push3(item2.apid)" round class="button1">交易中心</el-button>
                            </div>
                        </div>
                    </div>
                     <div class="line2"></div>
                    <!-- <div class="part3">
                        <div class="top_2">
                            <div>
                                <span class="top_2_title">广告位2</span>
                            </div>
                            <br>
                            <div class="mas_2_all">
                                <div class="msg_2">时间：1:45-1:48,1:54-1:59,2:03-2:09</div>
                                <div class="msg_2">场景：桌面</div>
                                <div class="msg_2">状态：已合作 3 个广告商</div>
                                <div class="msg_2">大小：3:4 10%</div>
                            </div>
                        </div>

                        <div class="bottom_2">
                            <div>
                               <img src="../../assets/producer_space/iconPark.png"/>
                               <img class="bottm_2_img" src="../../assets/producer_space/ad-product.png"/>
                            </div>
                            <div>
                                <img src="../../assets/producer_space/iconPark.png"/>
                               <img class="bottm_2_img"  src="../../assets/producer_space/ad-product.png"/>
                            </div>
                             <div>
                                 <img src="../../assets/producer_space/iconPark.png"/>
                               <img class="bottm_2_img"  src="../../assets/producer_space/ad-product.png"/>
                            </div>
                        </div>
                    </div> -->
                     <div class="line3">
                         <div @click="push(item.vid)"  class="line3_item">
                            <span class="line3_item_msg">更多</span>
                            <img src="../../assets/producer_space/iconPark-right.png"/>
                         </div>
                     </div>
                    <!-- <div class="part4">
                        <div class="top_2">
                            <div>
                                <span class="top_2_title">广告位3</span>
                            </div>
                            <br>
                            <div class="mas_2_all">
                                <div class="msg_2">时间：1:45-1:48,1:54-1:59,2:03-2:09</div>
                                <div class="msg_2">场景：桌面</div>
                                <div class="msg_2">状态：已合作 3 个广告商</div>
                                <div class="msg_2">大小：3:4 10%</div>
                            </div>
                        </div>

                        <div class="bottom_2">
                            <div>
                               <img src="../../assets/producer_space/iconPark.png"/>
                               <img class="bottm_2_img" src="../../assets/producer_space/ad-product.png"/>
                            </div>
                            <div>
                                <img src="../../assets/producer_space/iconPark.png"/>
                               <img class="bottm_2_img"  src="../../assets/producer_space/ad-product.png"/>
                            </div>
                             <div>
                                 <img src="../../assets/producer_space/iconPark.png"/>
                               <img class="bottm_2_img"  src="../../assets/producer_space/ad-product.png"/>
                            </div>
                        </div>
                    </div> -->
                     <div class="line4"></div>
                  </el-card>
                    <!-- <el-button @click="push3()" round class="button1">交易中心</el-button>
                    <el-button @click="push3()" round class="button2">交易中心</el-button>
                    <el-button @click="push3()" round class="button3">交易中心</el-button> -->
            </div>





            <!-- <div class="advert2">
                <el-card class="box-card">
                    <div class="part1">
                        <div class="vedio">
                            <img class="vedio_pic" src="../../assets/producer_space/vedio_pic.png"/>
                        </div>
                        <div class="fire">
                            <img class="fire-burn" src="../../assets/producer_space/if-fire-burn.png"/>
                            <span class="fire-degree">{{fire_degree}}</span>
                            <div  class="time">
                                <span class="time">{{time}}</span>
                            </div>
                        </div>
                        <div class="all_vedio_name">
                            <a class="vedio_name">{{vedio_name1}}</a><br>
                            <a class="vedio_name">{{vedio_name2}}</a>
                        </div>
                        <el-card class="type"><a class="type_a">{{type[0]}}</a></el-card>
                        <el-card class="type"><a  class="type_a">{{type[1]}}</a></el-card>
                    </div>
                    <div class="line1"></div>
                    <div class="part2">
                        <div class="top_2">
                            <div>
                                <span class="top_2_title">广告位1</span>
                            </div>
                            <br>
                            <div class="mas_2_all">
                                <div class="msg_2">时间：1:45-1:48,1:54-1:59,2:03-2:09</div>
                                <div class="msg_2">场景：桌面</div>
                                <div class="msg_2">状态：已合作 3 个广告商</div>
                                <div class="msg_2">大小：3:4 10%</div>
                            </div>
                        </div>

                        <div class="bottom_2">
                            <div>
                               <img src="../../assets/producer_space/iconPark.png"/>
                               <span class="bottom_2_title">雅诗兰黛</span>
                               <img class="bottm_2_img1" src="../../assets/producer_space/ad-product.png"/>
                               <span class="bottom_2_title1">粉底液</span>
                            </div>
                            <div>
                                <img src="../../assets/producer_space/iconPark.png"/>
                               <span class="bottom_2_title">雅迪电动车</span>
                               <img class="bottm_2_img"  src="../../assets/producer_space/ad-product.png"/>
                               <span class="bottom_2_title2">小小电瓶车</span>
                            </div>
                             <div>
                                 <img src="../../assets/producer_space/iconPark.png"/>
                               <span class="bottom_2_title">百岁山</span>
                               <img class="bottm_2_img2"  src="../../assets/producer_space/ad-product.png"/>
                               <span class="bottom_2_title3">新年促销活动</span>
                            </div>
                        </div>
                    </div>
                     <div class="line2"></div>
                    <div class="part3">
                        <img class="part3_img" src="../../assets/producer_space/iconPark-oceanengine.png"/>
                    </div>
                     <div class="line3">
                         <div @click="push()" class="line3_item">
                            <span class="line3_item_msg">更多</span>
                            <img src="../../assets/producer_space/iconPark-right.png"/>
                         </div>
                     </div>
                    <div class="part4">
                        <img class="part4_img" src="../../assets/producer_space/iconPark-oceanengine.png"/>
                    </div>
                     <div class="line4"></div>
                </el-card>
                    <el-button @click="push()" round class="button1">交易中心</el-button>
            </div> -->

  
      </div>
  </div>
</template>

<script>
export default {
    name:'producer_space',
    data() {
        return {
            producer_name:"波尔本",
            order_num:"56",
            tele_num:"13678276372",
            tele_mail:"26153738274@qq.com",
            fans:["30W","25W","66W","100W"],
            vedio_name1:"愿大家保护野生动物",
            vedio_name2:"构建美好家园",
            type:["科普","地面"],
            fire_degree:176,
            time:"7s+5s+6s/3:05",
            //一整个大的box
            boxcard:[],
            //上半部分个人信息
            createrTop:{},
        }
    },
     methods:{
        push:function(id){
            console.log(id)
            sessionStorage.setItem('vid',JSON.stringify(id))
            this.$router.push({path:'/producer_video_detail'})
        },
        push2(){
            this.$router.push({path:'/login'})
        },
         push3(apid){
             console.log(apid)
             sessionStorage.setItem('apid',JSON.stringify(apid))
            this.$router.push({path:'/producer_trade'})
        },
        //个人界面所有信息初始化
          CreatInit(){
            //获取上个界面存储的ID
            var params=JSON.parse(sessionStorage.getItem("cid"));
            console.log(params);
            params=Number(params)
            this.$axios({
               method:'post',
               url:'http://1.117.65.58:9001/videoandcreater/findallbycid',
               params:{"cid":params},
            }).then(response=>{
            console.log(response);
            const arr =response.data.data;
            console.log(arr);
            this.boxcard=arr;
            // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
           }).catch(function(err){
               console.log(err)
           })
        },
        //单个视频下的所有广告位，接口结束
        //创作者的个人信息
        ACreaterTop(){
            //获取上个界面存储的ID
            var params=JSON.parse(sessionStorage.getItem("vid"));
            console.log(params);
            params=Number(params)
            this.$axios({
               method:'post',
               url:'http://1.117.65.58:9001/videoandcreater/findallbyvid',
               params:{"vid":params},
            }).then(response=>{
            console.log(response);
            const arr =response.data.data.creater;
            console.log(arr);
            this.createrTop=arr;
            // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
           }).catch(function(err){
               console.log(err)
           })
        },
        CCreaterTop(){
             var params=JSON.parse(sessionStorage.getItem("cid"));
            console.log(params);
            params=Number(params)
            this.$axios({
               method:'post',
               url:'http://1.117.65.58:9001/creater/findbycid',
               params:{"cid":params},
            }).then(response=>{
            console.log(response);
            const arr =response.data.data;
            console.log(arr);
            console.log(888)
            this.createrTop=arr;
            // window.sessionStorage.setItem('userInfo',JSON.stringify(arr));
           }).catch(function(err){
               console.log(err)
           })
        },
        
    },
    mounted(){
            this.CreatInit();
            if(sessionStorage.getItem("loginType")==1)
            {
                console.log(6666)
                this.CCreaterTop();
            }
            else{
                console.log(7777)
                this.ACreaterTop();
            }
    }
}
</script>


<style  scoped>
@import "../../style/producer_space.css";
</style>